<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/web/header.jsp" %>
<title>修改</title>
</head>
<body>

<fieldset class="layui-elem-field" style='margin:20px;padding:20px'>
  <legend>信息维护</legend>
  <div class="layui-field-box">
   	<form class="layui-form layui-form-pane" lay-filter='formA'>
   	  <div class="layui-form-item">
	   <label class="layui-form-label">员工编号</label>
	    <div class="layui-input-inline">
	      <input type="text" name="empCode" required  lay-verify="required"
	        readonly  autocomplete="off" class="layui-input">
	    </div>
	   </div>
	   <div class="layui-form-item">
	    <label class="layui-form-label">项目编号</label>
	    <div class="layui-input-inline">
	      <input type="text" name="proCode" required lay-verify="required"  
	        readonly autocomplete="off" class="layui-input">
	    </div>
	   </div>
	  <div class="layui-form-item">
	    <label class="layui-form-label">绩效</label>
	    <div class="layui-input-inline">
	      <input type="text" name="score" required  lay-verify="required" 
	      placeholder="请输入绩效" autocomplete="off" class="layui-input">
	    </div>
	  </div>
	  
	  <div class="layui-form-item">
	    <div class="layui-input-inline">
		  <input type="button" class="layui-btn" lay-submit lay-filter="upd" value="确定">		   
	      <input type="button" class="layui-btn layui-btn-primary" value="重置" onclick="init()">
	    </div>
	    <input type="button" class="layui-btn" value="关闭" onclick="toClose()">
	  </div>
	  <input type="hidden" name="action" value="upd"  />
	</form>
  </div>
</fieldset>

<script type="text/javascript">
 init();
  function init(){//回显
	  var empCode='<%=request.getParameter("empCode") %>'
	  var proCode='<%=request.getParameter("proCode") %>'
	  ajax("/score",{empCode:empCode,proCode:proCode,action:'get'},'json',function(data){
			console.log(data)
// 			form.val("formA",data);
			$("input[name='empCode']").val(data.empCode)
			$("input[name='proCode']").val(data.proCode)
			$("input[name='score']").val(data.score)
		})
  }
  
	formOn("/score",'submit(upd)',"text",function(data){
// 	console.log(data)
	 if("1"==data){
		layer.msg("修改成功",toClose)
	}else{
		layer.msg("修改失败");
	}
})
</script>

</body>
</html>